//
//  FourViewController4_1.m
//  真·豆瓣半完全体
//
//  Created by dllo on 15/12/31.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "FourViewController4_1.h"
#import "AdminView.h"
#import "FourViewController4_2.h"
@interface FourViewController4_1 ()

@end

@implementation FourViewController4_1
- (void)dealloc{
    [super dealloc];
}
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:240/255.0 green:240/255.0 blue:240/255.0 alpha:1];
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"用户登陆";
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(action:)];
    self.navigationItem.leftBarButtonItem = item;
    
    AdminView *admin = [[AdminView alloc] initWithFrame:CGRectMake(10, 40, 375, 50)];
    admin.Label.text = @"用户名:";
    admin.tf.placeholder = @"请输入用户";
    [self.view addSubview:admin];
    [admin release];
    AdminView *admin2 = [[AdminView alloc] initWithFrame:CGRectMake(10, 100, 375, 50)];
    admin2.Label.text = @"密码:";
    admin2.tf.placeholder = @"请输入密码";
    [self.view addSubview:admin2];
    [admin2 release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(50, 200, 100, 50);
    button.layer.cornerRadius = 10;
    button.backgroundColor = [UIColor colorWithRed:162/255.0 green:201/255.0 blue:81/255.0 alpha:1];
    [button setTitle:@"登陆" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.showsTouchWhenHighlighted = YES;
    [self.view addSubview:button];
    [button release];
    [button addTarget:self action:@selector(buttonAction2:) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    button2.frame = CGRectMake(220, 200, 100, 50);
    button2.layer.cornerRadius = 10;
    button2.backgroundColor = [UIColor colorWithRed:223/255.0 green:131/255.0 blue:54/255.0 alpha:1];
    [button2 setTitle:@"注册" forState:UIControlStateNormal];
    [button2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button2.showsTouchWhenHighlighted = YES;
    [self.view addSubview:button2];
    [button2 release];
    [button2 addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void) buttonAction:(UIButton *) button{
    FourViewController4_2 *fourVc2 = [[FourViewController4_2 alloc] init];
    [self.navigationController pushViewController:fourVc2 animated:YES];
}
- (void) buttonAction2:(UIButton *)button{
    self.block(@"注销");
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}



- (void)action:(UIBarButtonItem *)item{
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
